package com.bluefish.bltuan.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bluefish.bltuan.dao.SettingDao;
import com.bluefish.bltuan.module.config.Setting;
import com.bluefish.bltuan.module.config.SettingEnum;
import com.bluefish.bltuan.service.SettingService;

@Service
@Transactional
public class SettingServiceImpl implements SettingService {

    private SettingDao settingDao;

    public void setSettingDao(SettingDao settingDao) {
        this.settingDao = settingDao;
    }

    public void save(Setting t) {
        this.settingDao.save(t);
    }

    public void update(Setting t) {
        this.settingDao.update(t);
    }

    public void delete(Setting t) {
        this.settingDao.delete(t);
    }

    public Setting findById(Integer id) {
        return this.settingDao.findById(id);
    }

    public void saveOrUpdate(Setting t) {
        this.settingDao.saveOrUpdate(t);
    }

    public List<Setting> listSettings() {
        return this.settingDao.list();
    }

    public Setting getByKey(SettingEnum key) {
        return this.settingDao.getByKey(key);
    }

}
